import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'
import NoAuthPage from '@/page/NoAuthPage.vue'
import UserLayout from '@/layouts/UserLayout.vue'
import UserLoginPage from '@/page/user/UserLoginPage.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/user',
      name: '用户',
      component: UserLayout,
      children: [
        {
          path: '/user/login',
          name: '用户登录',
          component: UserLoginPage,
        },
      ],
      meta: {
        hideInMenu: true,
      },
    },
    {
      path: '/',
      name: 'home',
      component: HomeView,
    },
    {
      path: '/noAuth',
      name: '无权限',
      component: NoAuthPage,
      meta: {
        hideInMenu: true,
      },
    },
  ],
})

export default router
